#include "gameinfomgr.h"



GameInfoMgr::GameInfoMgr()
{
}
GameInfoMgr::~GameInfoMgr()
{
}

bool GameInfoMgr::Update(stGameInfo&& gameinfo)
{
    m_mgr[gameinfo.agency_id][gameinfo.game] = std::move(gameinfo);
    return true;
}
bool GameInfoMgr::Update(const stGameInfo& gameinfo)
{
    m_mgr[gameinfo.agency_id][gameinfo.game] = gameinfo;
    return true;
}
stGameInfo* GameInfoMgr::Get(const std::uint32_t agency_id, const std::uint32_t game)
{
    auto it_agency = m_mgr.find(agency_id);
    if (it_agency == m_mgr.end())
    {
        return nullptr;
    }
    auto it_game = it_agency->second.find(game);
    if (it_game == it_agency->second.end())
    {
        return nullptr;
    }
    return &it_game->second;
}









